package com.example.springboot_carlos.entiy;

public class Article {
    private String title;
    private String author;
    private String content;

    public Article(String title, String author, String content) {
        this.title = title;
        this.author = author;
        this.content = content;
    }

    public String getTitle() {
        return title;
    }

    public String getAuthor() {
        return author;
    }

    public String getContent() {
        return content;
    }

    @Override
    public String toString() {
        return "Article{" +
                "title='" + title + '\'' +
                ", author='" + author + '\'' +
                ", content='" + content + '\'' +
                '}';
    }
    public static boolean allNull(Article article){
        String title = article.getTitle();
        String author=article.getAuthor();
        String content= article.getContent();
        if(title==null&&author==null&&content==null){
            return true;
        }else if(title.isEmpty()&&author.isEmpty()&&content.isEmpty()){
            return true;
        }else{
            return false;
        }
    }
}
